package com.wanwu.channel.biz.channel;

import com.wanwu.channel.biz.TradeOrder;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class WebchatPayParameterService extends PayParameterService {
    @Override
    public Map getPayParameter(String tradeNo) {
        TradeOrder tradeOrder = queryTradeOrder(tradeNo);
        Map<String, Object> requestParameter = new HashMap();
        Map<String, Object> amount = new HashMap();
        amount.put("total", tradeOrder.getTotalFee());
        requestParameter.put("amount", amount);
        requestParameter.put("appId", "wxa9d9651ae000001");
        requestParameter.put("mchid", tradeOrder.getMerchantCode());
        requestParameter.put("description", tradeOrder.getGoodsBody());
        requestParameter.put("notifyUrl", tradeOrder.getNotifyUrl());
        requestParameter.put("outTradeNo", tradeOrder.getOutTradeNo());
        return requestParameter;
    }
}
